/**
 * 2017年11月9日
 */
package com.alibaba.study.socketdemo;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Arrays;

/**
 * @author Alex
 *
 */
public class Server {
	public static void main(String[] args) throws IOException {
		ServerSocket ss = new ServerSocket(8081);
		Socket  s = ss.accept();
		
		byte[] arr = new byte[1024 ];
		InputStream is = s.getInputStream();
		int k = is.read(arr, 0, arr.length);
		System.out.println(Arrays.toString(arr));
		for(int i= 0;i<k;i++){
			System.out.println(Integer.toBinaryString(arr[i]));
		}
		
	}
}
